﻿using System;
using System.Web.UI.WebControls;
using BLL;

public partial class ProductAging_ViewAging_ViewAgingbyDT : System.Web.UI.Page
{
    private Aging ag;

    public ProductAging_ViewAging_ViewAgingbyDT()
    {
        ag = new Aging(); 
    }

    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        BindAging();
    }

    protected void BindAging()
    {
        DateTime dt1 = DateTime.Parse(this.TextBox1.Value.Trim());
        DateTime dt2 = DateTime.Parse(this.TextBox2.Value.Trim());
        this.GridView1.DataSource = ag.GetAgingsbyDT(dt1,dt2);
        this.GridView1.DataBind();
    }

    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.GridView1.PageIndex = e.NewPageIndex;
        BindAging();
    }

    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        string agingID = GridView1.SelectedDataKey["AgingID"].ToString();
        Response.Redirect("~/ProductAging/ViewAging/AgingDetailinMaster.aspx?agingID=" + agingID);
    }
}
